<template>
	<view>
		<view class="contianer">
			<view class="tips-text">{{lines > 0?'恭喜您':'很抱歉'}}，</view>
			<view class="tips-text">获得房屋二押额度！</view>
			<view class="price">
				<text class="fuhao">￥</text>
				<text>{{lines}}</text>
			</view>
			<text class="desc" v-if="lines > 0">以上额度仅供参考，以实际审批结果为准，我司有权随时为您调整额度。</text>
			<text class="desc" v-else>若无法满足您的申请额度，请点击下方申请调额或直接联系业务经理完成额度调整，增额结果以最终审批为准</text>

			<!-- 按钮 -->
			<view class="btn-box">
				<view class="btn" @click="applyQuota" data-type="1">申请提额</view>
				<view class="btn btn1" @click="applyQuota" data-type="2">申请调额</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lines: 0, //额度
				phone: '',
			}
		},
		onLoad: function(options) {
			this.lines = options.data;
			this.phone = options.phone;
	},
	methods: {
		//申请提额/调额
		applyQuota(e) {
			let type = e.currentTarget.dataset.type;
			this.$api.applyQuota({
				fromStatus: type,
				phoneNumber: this.phone
			}).then(res => {
				uni.navigateTo({
					url: '/pages/application-results/index',
				})
			})
		},
	}
	}
</script>

<style scoped>
	/* pages/ce-results/index.wxss */
	page {
	  background-color: #fff;
	}
	
	.contianer {
	  padding: 50rpx 30rpx;
	}
	
	.tips-text {
	  font-size: 38rpx;
	  color: #333333;
	  margin-bottom: 30rpx;
	}
	
	.price {
	  margin-top: 30rpx;
	  font-size: 60rpx;
	  font-family: PingFang SC;
	  font-weight: 800;
	  color: #333333;
	  margin-bottom: 50rpx;
	}
	.fuhao{
	  font-size: 32rpx;
	}
	.desc{
	  font-size: 28rpx;
	color: #999999;
	}
	
	.btn-box{
	  position: absolute;
	  left: 30rpx;
	  right: 30rpx;
	  bottom: 60rpx;
	
	}
	.btn{
	  width: 100%;
	  height: 98rpx;
	background: #585CF7;
	border-radius: 49rpx;
	margin-top: 20rpx;
	text-align: center;
	line-height: 98rpx;
	font-size: 36rpx;
	color: #FFFFFF;
	}
	.btn1{
	  border: 1rpx solid #999999;
	  background-color: transparent;
	  color: #585CF7;
	}

</style>
